package com.example.caslistview;

import java.util.ArrayList;
import java.util.List;

import com.example.caslistview.view.CasListView;

import android.os.Bundle;
import android.view.View;
import android.app.Activity;

public class MainActivity extends Activity {

	List<View> headerList = null;
	List<Object> list1 = null;
	List<Object> list2 = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		initView();
	}

	private void initView() {
		headerList = new ArrayList<View>();
		View header1 = getLayoutInflater().inflate(R.layout.header1, null);
		View header2 = getLayoutInflater().inflate(R.layout.header2, null);
		headerList.add(header1);
		headerList.add(header2);
		
		list1= new ArrayList<Object>();
		list2= new ArrayList<Object>();
		for(int i=0;i<20;i++){
			list1.add("This is first listview item"+i);
			list2.add("This is second listview item"+i);
		}
		
		
		CasListView listView = (CasListView) findViewById(R.id.lv_main);
		listView.setAdapter(headerList, list1, list2);
	}

}
